# 组件名称
set(COMPONENT_NAME ComponentB)

# 添加库
add_library(${COMPONENT_NAME} STATIC ${COMPONENT_NAME}.c)

# 为库创建一个导入目标，以便更容易地在其他地方使用
# add_library(${COMPONENT_NAME}::${COMPONENT_NAME} ALIAS ${COMPONENT_NAME})

# 包含路径、链接库等可以在这里设置
target_include_directories(${COMPONENT_NAME} PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    $<INSTALL_INTERFACE:include>
)

# 处理依赖关系（如果有）
if(TARGET ComponentA)
    target_link_libraries(${COMPONENT_NAME} PRIVATE ComponentA)
else()
    message(WARNING "ComponentA is not available, some features in ComponentB may be disabled.")
endif()